/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */

package com.haulmont.asu.entity;

import com.haulmont.chile.core.annotations.NamePattern;
import com.haulmont.cuba.core.entity.StandardEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Author: Sergey42
 * Date: 17.10.13 14:11
 */
@Table(name = "ASU_WORK")
@Entity(name = "asu$Work")
@NamePattern("%s|name")
public class Work extends StandardEntity {

    private static final long serialVersionUID = 4355353684770259929L;

    @Column(name = "NAME")
    protected String name;

    @Column(name = "WORK_ORDER")
    protected Integer order;

    @ManyToOne
    @JoinColumn(name = "STEP_ID")
    protected Step step;

    @ManyToOne
    @JoinColumn(name = "PROJECT_ID")
    protected Project project;

    @ManyToOne
    @JoinColumn(name = "DEPARTMENT_ID")
    protected Department department;

    @Column(name = "PLAN_START_DATE")
    @Temporal(TemporalType.DATE)
    protected Date planStartDate;

    @Column(name = "FACT_START_DATE")
    @Temporal(TemporalType.DATE)
    protected Date factStartDate;

    @Column(name = "PLAn_FINISH_DATE")
    @Temporal(TemporalType.DATE)
    protected Date planFinishDate;

    @Column(name = "FACT_FINISH_DATE")
    @Temporal(TemporalType.DATE)
    protected Date factFinishDate;

    @Column(name = "AMOUNT")
    protected BigDecimal amount;

    @Column(name = "MARK_FINISHED")
    protected Boolean markFinished;

    public Boolean getMarkFinished() {
        return markFinished;
    }

    public void setMarkFinished(Boolean markFinished) {
        this.markFinished = markFinished;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    public Step getStep() {
        return step;
    }

    public void setStep(Step step) {
        this.step = step;
    }

    public Project getProject() {
        return project;
    }

    public void setProject(Project project) {
        this.project = project;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public Date getPlanStartDate() {
        return planStartDate;
    }

    public void setPlanStartDate(Date planStartDate) {
        this.planStartDate = planStartDate;
    }

    public Date getFactStartDate() {
        return factStartDate;
    }

    public void setFactStartDate(Date factStartDate) {
        this.factStartDate = factStartDate;
    }

    public Date getPlanFinishDate() {
        return planFinishDate;
    }

    public void setPlanFinishDate(Date planFinishDate) {
        this.planFinishDate = planFinishDate;
    }

    public Date getFactFinishDate() {
        return factFinishDate;
    }

    public void setFactFinishDate(Date factFinishDate) {
        this.factFinishDate = factFinishDate;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }
}
